<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>{$title}-{$config['index_store_name']}</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"  />
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="format-detection" content="telphone=no, email=no"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/shop/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/shop/css/swiper.min.css"/>
    <script type="text/javascript" src="__PUBLIC__/shop/js/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/shop/js/swiper.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/shop/js/index.js"></script>
    <script type="text/javascript" src="__PUBLIC__/home/js/index.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/layer.js"></script>
    <script typet="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
    <script>
        //ajax获取购物车
        var b_request = 1;
        function CartList(){
            if(b_request == 0)
                return false;
            b_request = 0;
            $.ajax({
                type : "POST",
                url:"/Home/Cart/ajax_index.html",
                dataType: 'json',
                data: $('#cart_sub').serialize(),
                success: function(data){
                    if(data){
                        $("#cart-list").empty().append(data);
                        b_request = 1;
                    }
                }
            });
        }

        //改变购物车数量
        function switch_num(num,obj,s = false){
            var store_count = parseInt($("#in"+ obj).attr('max'));
            var num2 = parseInt($("#in"+ obj).val());
            num2 += num;
            if(num2 < 1) num2 = 1;
            if(num2 > store_count){
                num2 = store_count;
            }
            $("#in"+ obj).val(num2);
            if(s){
                CartList();
            }
        }
    </script>
</head>